package com.test.springboot.demo.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.test.springboot.demo.dao.AccountDAO;
import com.test.springboot.demo.pojo.WechatAccount;
import com.test.springboot.demo.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountDAO accountDAO;

    @Override
    public PageInfo<WechatAccount> getAccountList(Map param, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return new PageInfo<>(accountDAO.getAccountList(param),5);
    }

    @Override
    public WechatAccount getAccountById(Integer id) {
        return accountDAO.getAccountById(id);
    }

    @Override
    public void updateAccount(WechatAccount accont) {
        accountDAO.updateAccount(accont);
    }
}
